package com.sfa.dto;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class RestExample
{

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public RestExample()
    {

        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause)
    {

        this.orderByClause = orderByClause;
    }

    public String getOrderByClause()
    {

        return orderByClause;
    }

    public void setDistinct(boolean distinct)
    {

        this.distinct = distinct;
    }

    public boolean isDistinct()
    {

        return distinct;
    }

    public List<Criteria> getOredCriteria()
    {

        return oredCriteria;
    }

    public void or(Criteria criteria)
    {

        oredCriteria.add(criteria);
    }

    public Criteria or()
    {

        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria()
    {

        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0)
        {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal()
    {

        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear()
    {

        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria
    {

        protected List<Criterion> criteria;

        protected GeneratedCriteria()
        {

            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid()
        {

            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria()
        {

            return criteria;
        }

        public List<Criterion> getCriteria()
        {

            return criteria;
        }

        protected void addCriterion(String condition)
        {

            if (condition == null)
            {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property)
        {

            if (value == null)
            {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property)
        {

            if (value1 == null || value2 == null)
            {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        protected void addCriterionForJDBCDate(String condition, Date value, String property)
        {

            if (value == null)
            {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value.getTime()), property);
        }

        protected void addCriterionForJDBCDate(String condition, List<Date> values, String property)
        {

            if (values == null || values.size() == 0)
            {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
            Iterator<Date> iter = values.iterator();
            while (iter.hasNext())
            {
                dateList.add(new java.sql.Date(iter.next().getTime()));
            }
            addCriterion(condition, dateList, property);
        }

        protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property)
        {

            if (value1 == null || value2 == null)
            {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
        }

        public Criteria andRestIdIsNull()
        {

            addCriterion("rest_id is null");
            return (Criteria) this;
        }

        public Criteria andRestIdIsNotNull()
        {

            addCriterion("rest_id is not null");
            return (Criteria) this;
        }

        public Criteria andRestIdEqualTo(Integer value)
        {

            addCriterion("rest_id =", value, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdNotEqualTo(Integer value)
        {

            addCriterion("rest_id <>", value, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdGreaterThan(Integer value)
        {

            addCriterion("rest_id >", value, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdGreaterThanOrEqualTo(Integer value)
        {

            addCriterion("rest_id >=", value, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdLessThan(Integer value)
        {

            addCriterion("rest_id <", value, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdLessThanOrEqualTo(Integer value)
        {

            addCriterion("rest_id <=", value, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdIn(List<Integer> values)
        {

            addCriterion("rest_id in", values, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdNotIn(List<Integer> values)
        {

            addCriterion("rest_id not in", values, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdBetween(Integer value1, Integer value2)
        {

            addCriterion("rest_id between", value1, value2, "restId");
            return (Criteria) this;
        }

        public Criteria andRestIdNotBetween(Integer value1, Integer value2)
        {

            addCriterion("rest_id not between", value1, value2, "restId");
            return (Criteria) this;
        }

        public Criteria andRestTitleIsNull()
        {

            addCriterion("rest_title is null");
            return (Criteria) this;
        }

        public Criteria andRestTitleIsNotNull()
        {

            addCriterion("rest_title is not null");
            return (Criteria) this;
        }

        public Criteria andRestTitleEqualTo(String value)
        {

            addCriterion("rest_title =", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleNotEqualTo(String value)
        {

            addCriterion("rest_title <>", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleGreaterThan(String value)
        {

            addCriterion("rest_title >", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleGreaterThanOrEqualTo(String value)
        {

            addCriterion("rest_title >=", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleLessThan(String value)
        {

            addCriterion("rest_title <", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleLessThanOrEqualTo(String value)
        {

            addCriterion("rest_title <=", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleLike(String value)
        {

            addCriterion("rest_title like", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleNotLike(String value)
        {

            addCriterion("rest_title not like", value, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleIn(List<String> values)
        {

            addCriterion("rest_title in", values, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleNotIn(List<String> values)
        {

            addCriterion("rest_title not in", values, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleBetween(String value1, String value2)
        {

            addCriterion("rest_title between", value1, value2, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestTitleNotBetween(String value1, String value2)
        {

            addCriterion("rest_title not between", value1, value2, "restTitle");
            return (Criteria) this;
        }

        public Criteria andRestRequestIsNull()
        {

            addCriterion("rest_request is null");
            return (Criteria) this;
        }

        public Criteria andRestRequestIsNotNull()
        {

            addCriterion("rest_request is not null");
            return (Criteria) this;
        }

        public Criteria andRestRequestEqualTo(String value)
        {

            addCriterion("rest_request =", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestNotEqualTo(String value)
        {

            addCriterion("rest_request <>", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestGreaterThan(String value)
        {

            addCriterion("rest_request >", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestGreaterThanOrEqualTo(String value)
        {

            addCriterion("rest_request >=", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestLessThan(String value)
        {

            addCriterion("rest_request <", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestLessThanOrEqualTo(String value)
        {

            addCriterion("rest_request <=", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestLike(String value)
        {

            addCriterion("rest_request like", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestNotLike(String value)
        {

            addCriterion("rest_request not like", value, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestIn(List<String> values)
        {

            addCriterion("rest_request in", values, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestNotIn(List<String> values)
        {

            addCriterion("rest_request not in", values, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestBetween(String value1, String value2)
        {

            addCriterion("rest_request between", value1, value2, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestRequestNotBetween(String value1, String value2)
        {

            addCriterion("rest_request not between", value1, value2, "restRequest");
            return (Criteria) this;
        }

        public Criteria andRestResponseIsNull()
        {

            addCriterion("rest_response is null");
            return (Criteria) this;
        }

        public Criteria andRestResponseIsNotNull()
        {

            addCriterion("rest_response is not null");
            return (Criteria) this;
        }

        public Criteria andRestResponseEqualTo(String value)
        {

            addCriterion("rest_response =", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseNotEqualTo(String value)
        {

            addCriterion("rest_response <>", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseGreaterThan(String value)
        {

            addCriterion("rest_response >", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseGreaterThanOrEqualTo(String value)
        {

            addCriterion("rest_response >=", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseLessThan(String value)
        {

            addCriterion("rest_response <", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseLessThanOrEqualTo(String value)
        {

            addCriterion("rest_response <=", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseLike(String value)
        {

            addCriterion("rest_response like", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseNotLike(String value)
        {

            addCriterion("rest_response not like", value, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseIn(List<String> values)
        {

            addCriterion("rest_response in", values, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseNotIn(List<String> values)
        {

            addCriterion("rest_response not in", values, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseBetween(String value1, String value2)
        {

            addCriterion("rest_response between", value1, value2, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestResponseNotBetween(String value1, String value2)
        {

            addCriterion("rest_response not between", value1, value2, "restResponse");
            return (Criteria) this;
        }

        public Criteria andRestDateIsNull()
        {

            addCriterion("rest_date is null");
            return (Criteria) this;
        }

        public Criteria andRestDateIsNotNull()
        {

            addCriterion("rest_date is not null");
            return (Criteria) this;
        }

        public Criteria andRestDateEqualTo(Date value)
        {

            addCriterionForJDBCDate("rest_date =", value, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateNotEqualTo(Date value)
        {

            addCriterionForJDBCDate("rest_date <>", value, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateGreaterThan(Date value)
        {

            addCriterionForJDBCDate("rest_date >", value, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateGreaterThanOrEqualTo(Date value)
        {

            addCriterionForJDBCDate("rest_date >=", value, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateLessThan(Date value)
        {

            addCriterionForJDBCDate("rest_date <", value, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateLessThanOrEqualTo(Date value)
        {

            addCriterionForJDBCDate("rest_date <=", value, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateIn(List<Date> values)
        {

            addCriterionForJDBCDate("rest_date in", values, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateNotIn(List<Date> values)
        {

            addCriterionForJDBCDate("rest_date not in", values, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateBetween(Date value1, Date value2)
        {

            addCriterionForJDBCDate("rest_date between", value1, value2, "restDate");
            return (Criteria) this;
        }

        public Criteria andRestDateNotBetween(Date value1, Date value2)
        {

            addCriterionForJDBCDate("rest_date not between", value1, value2, "restDate");
            return (Criteria) this;
        }
    }

    /**
     */
    public static class Criteria extends GeneratedCriteria
    {

        protected Criteria()
        {

            super();
        }
    }

    public static class Criterion
    {

        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition()
        {

            return condition;
        }

        public Object getValue()
        {

            return value;
        }

        public Object getSecondValue()
        {

            return secondValue;
        }

        public boolean isNoValue()
        {

            return noValue;
        }

        public boolean isSingleValue()
        {

            return singleValue;
        }

        public boolean isBetweenValue()
        {

            return betweenValue;
        }

        public boolean isListValue()
        {

            return listValue;
        }

        public String getTypeHandler()
        {

            return typeHandler;
        }

        protected Criterion(String condition)
        {

            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler)
        {

            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>)
            {
                this.listValue = true;
            }
            else
            {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value)
        {

            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler)
        {

            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue)
        {

            this(condition, value, secondValue, null);
        }
    }
}